import './assets/iconfont/iconfont.css'
import './assets/iconfont/iconfont.js'
import '@/assets/main.css'
import 'animate.css';
import 'nprogress/nprogress.css'
import 'default-passive-events'
// 导入 element-plus 暗黑 css
import 'element-plus/theme-chalk/dark/css-vars.css'
// 导入 Element Plus 图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import '/index.js'
import { createApp} from 'vue'
import App from '@/App.vue'
// 导入路由
import router from '@/router'
import '@/permission'
// 引入全局状态管理 Pinia
import pinia from '@/stores'
// 引入图片点击放大
import 'viewerjs/dist/viewer.css'
import VueViewer from 'v-viewer'
import '@/assets/iconfont/iconfont.js'
import SvgIcon from '@/components/SvgIcon.vue'
//引入图片懒加载插件
import lazyPlugin from "vue3-lazy"

const app = createApp(App)

// 图片懒加载
app.use(lazyPlugin, {
  loading: 'loading.gif',//可以指定加载中的图像
  error: 'error.png',//可以指定加载失败的图像
});

// 引入图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 2. 注册SvgIcon
app.component('svg-icon', SvgIcon)



import PageButton from '@/components/PageButton.vue'
app.component('ym-page', PageButton);

import EmptyData from './components/EmptyData.vue';
app.component('ym-empty', EmptyData);

// 应用路由user(router)
app.use(router)
app.use(pinia)
app.use(VueViewer)
app.mount('#app')